<template>
  <view class="index">
    <view class="jtop">
      <view class="status_bar"><!-- 这里是状态栏 --></view>
      <view class="jtop_l" @tap="navigateBack"
        ><image src="../../static/img/ic_back.png"></image
      ></view>
      <view class="jtop_c">个人信息</view>
      <view class="jtop_r" @tap="jshow_pop"
        ><image src="../../static/img/index/ic_ellipsis.png"></image
      ></view>
    </view>
    <view class="tophr"></view>

    <view class="tm_t">
      <image :src="head_jdelulpture" class="tm_tl"></image>
      <view class="tm_tr_t">
        <text>{{ realname }}</text>
        <image
          src="../../static/img/index/new/ic_man.png"
          v-if="sex == '2'"
        ></image>
        <image
          src="../../static/img/index/new/ic_woman.png"
          v-else-if="sex == '1'"
        ></image>
      </view>
    </view>

    <view class="tm_f">
      <view class="tm_fb">
        <view class="tm_f1">
          电话
        </view>
        <view class="tm_f2">
          {{ mobile }}
        </view>
        <image
          src="../../static/img/index/new/ic_phone_blue.png"
          @click="pc(mobile)"
        ></image>
      </view>
      <view class="tm_fb">
        <view class="tm_f1">
          邮箱
        </view>
        <view class="tm_f2">
          {{ mail }}
        </view>
        <image
          src="../../static/img/index/new/ic_mail_blue.png"
          @click="jmail(mail)"
        ></image>
      </view>
    </view>

    <!-- 弹出层 -->
    <view :class="[ashowpop ? 'tc' : 'tc hide']">
      <view class="jtop_bj" @click="jshow_pop"></view>

      <view class="tc_fbox">
        <view class="tc_fbox_bt2" @click="btTC2">
          编辑成员
        </view>
        <view class="tc_fbox_bt" @click="jshow_pop">
          取消
        </view>
      </view>
    </view>
  </view>
</template>

<script>
import request from '@/common/request.js';
import { mapState } from 'vuex';

export default {
  computed: mapState(['forcedLogin', 'hasLogin', 'userName']),
  data() {
    return {
      repeat_click: true,
      ashowpop: false,
      id: '',
      realname: '',
      duty: '',
      mobile: '',
      sex: '',
      mail: '',
      head_jdelulpture: '',
    };
  },
  onLoad(e) {
    console.log('onLoad:', e);

    this.id = e.id;
    this.realname = e.realname;
    this.duty = e.duty;
    this.mobile = e.mobile;
    this.sex = e.sex;
    this.mail = e.mail;

    if (!uni.getStorageSync('jenterpriselstx')) {
      this.head_jdelulpture = '../../static/img/Default_avatar.png';
    } else {
      this.head_jdelulpture = uni.getStorageSync('jenterpriselstx');
    }
    console.log(this.realname);
  },
  methods: {
    pc(e) {
      uni.makePhoneCall({
        phoneNumber: e,
      });
    },
    jmail(value) {
      console.log(value);
      uni.setClipboardData({
        data: value,
      });
    },
    btTC2() {
      uni.navigateTo({
        url:
          '../user/tream_edit?id=' +
          this.id +
          '&realname=' +
          this.realname +
          '&duty=' +
          this.duty,
      });
    },
    navigateBack() {
      uni.navigateBack();
    },
    tel_more() {
      uni.navigateTo({
        url: '../main/tel_more',
      });
    },
    jshow_pop() {
      this.ashowpop = !this.ashowpop;
    },
    add() {
      uni.navigateTo({
        url: '../main/tel_add',
      });
    },
  },
};
</script>

<style>
.tc {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  display: block;
}
.jtop_bj {
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
}
.tc_fbox_bt {
  width: 100%;
  height: 90rpx;
  line-height: 90rpx;
  display: block;
  float: left;
  text-align: center;
  font-size: 36rpx;
  color: #000000;
  border-top: 20rpx solid #f2f2f2;
  background: #ffffff;
}
.tc_fbox {
  width: 100%;
  height: auto;
  display: block;
  float: left;
  background: #f2f2f2;
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 10001;
}
.tc_fbox_bt2 {
  width: 100%;
  height: 90rpx;
  line-height: 90rpx;
  display: block;
  float: left;
  text-align: center;
  font-size: 36rpx;
  color: #000000;
  border-top: 0rpx solid #f2f2f2;
  background: #ffffff;
}

.tm_t {
  width: 100%;
  height: auto;
  display: block;
  float: left;
  margin: 20rpx 0 0;
  background: #ffffff;
  border: 1px solid #dddddd;
  border-left: 0;
  border-right: 0;
}
.tm_tl {
  width: 120rpx;
  height: 120rpx;
  display: block;
  float: left;
  margin: 30rpx 20rpx 30rpx 30rpx;
}
.tm_tr_t {
  width: 500rpx;
  height: auto;
  display: block;
  float: left;
  margin: 70rpx 0rpx 0rpx 0rpx;
}
.tm_tr_t text {
  width: auto;
  height: auto;
  display: block;
  float: left;
  font-size: 34rpx;
  color: #000000;
  line-height: 42rpx;
  margin: 0 0 0 0rpx;
}
.tm_tr_t image {
  width: 32rpx;
  height: 32rpx;
  display: block;
  float: left;
  margin: 8rpx 0 0 10rpx;
}
.tm_tr_f {
  width: 500rpx;
  height: auto;
  display: block;
  float: left;
  margin: 10rpx 0rpx 0rpx 0rpx;
  font-size: 24rpx;
  color: #999999;
  line-height: 32rpx;
}

.tm_f {
  width: 100%;
  height: auto;
  display: block;
  float: left;
  background: #ffffff;
  border: 1px solid #dddddd;
  border-left: 0;
  border-right: 0;
  margin: 20rpx 0 0;
}
.tm_fb {
  width: 720rpx;
  margin: 0 0 0 30rpx;
  height: 90rpx;
  display: block;
  float: left;
  background: #ffffff;
  border-bottom: 1px solid #dddddd;
}
.tm_fb:last-child {
  border: 0;
}
.tm_f1 {
  width: auto;
  margin: 0 50rpx 0 0rpx;
  height: 90rpx;
  line-height: 90rpx;
  display: block;
  float: left;
  font-size: 34rpx;
  color: #000000;
}
.tm_f2 {
  width: auto;
  margin: 0 50rpx 0 0rpx;
  height: 90rpx;
  line-height: 90rpx;
  display: block;
  float: left;
  font-size: 32rpx;
  color: #000000;
}
.tm_f image {
  width: 48rpx;
  margin: 21rpx 30rpx 0 0rpx;
  height: 48rpx;
  display: block;
  float: right;
}

.tophr {
  width: 100%;
  height: 88rpx;
}
.uni-searchbar {
  box-shadow: none;
}

.dcf {
  width: 100%;
  height: 120rpx;
  display: block;
  float: left;
  position: fixed;
  left: 0;
  bottom: 0;
  background: #ffffff;
  box-shadow: inset 0px 1px 0px #dddddd;
  z-index: 1000;
  padding: 18rpx 30rpx;
  box-sizing: border-box;
}
.dcf_tx {
  width: 84rpx;
  height: 84rpx;
  display: block;
  float: left;
  margin: 0rpx 20rpx 0rpx 0;
}
.dcf_t {
  width: auto;
  height: 84rpx;
  line-height: 84rpx;
  display: block;
  float: right;
  margin: 0rpx 0rpx 0rpx 0;
  font-size: 36rpx;
  color: #256aff;
}

.index {
  background: rgb(242, 242, 242);
  width: 100%;
  height: auto;
}
.jtop {
  width: 100%;
  height: 88rpx;
  background: #ffffff;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}
.jtop_l {
  width: auto;
  height: 88rpx;
  display: block;
  float: left;
  font-size: 32rpx;
  color: #000000;
  line-height: 88rpx;
  margin: 0 0 0 30rpx;
}
.jtop_l image {
  width: 48rpx;
  height: 48rpx;
  display: block;
  float: left;
  margin: 20rpx 0 20rpx 0;
}
.jtop_r {
  width: auto;
  height: 88rpx;
  display: block;
  float: right;
  margin: 20rpx 20rpx 0 0;
  line-height: 88rpx;
  font-size: 32rpx;
  color: #000000;
  color: #256aff;
}
.jtop_r image {
  width: 48rpx;
  height: 48rpx;
  display: block;
  float: left;
}
.jtop_c {
  width: 70%;
  height: 48rpx;
  line-height: 48rpx;
  display: block;
  float: left;
  position: fixed;
  top: 20rpx;
  left: 15%;
  text-align: center;
  font-size: 36rpx;
  color: #000000;
}
.jtop_c image {
  width: 36rpx;
  height: 36rpx;
  display: inline-block;
  float: none;
  margin-bottom: -5rpx;
  margin-left: 5rpx;
}
.jtop_b {
  width: 100%;
  height: auto;
  background: #ffffff;
  position: fixed;
  top: 88rpx;
  left: 0;
  z-index: 1001;
}

.uni-searchbar {
  background: rgb(242, 242, 242);
}
.index .uni-searchbar__box {
  background: #ffffff !important;
}
</style>
